package com.qingcloud.adminbackend.entity.app;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 作业表
 * </p>
 *
 * @author wangjinnan
 * @since 2021-01-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("df_job")
public class Job implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键，公用开发作业主键
     */
    @TableId(type = IdType.INPUT)
    @ApiModelProperty(value = "主键ID", example = "1")
    private Integer id;

    @ApiModelProperty(value = "开发作业", example = "1")
    private Integer developId;

    @ApiModelProperty(value = "应用ID", example = "1")
    private Integer appId;

    /**
     * 作业组ID
     */
    @ApiModelProperty(value = "作业组ID", example = "1")
    private String groupId;

    /**
     * 所属项目ID
     */
    @ApiModelProperty(value = "所属项目ID", example = "1")
    private String projectId;

    /**
     * 数据来源ID
     */
    @ApiModelProperty(value = "数据来源ID", example = "1")
    private Integer sourceId;

    /**
     * 作业名称
     */
    @ApiModelProperty(value = "作业名称", example = "1")
    private String name;

    /**
     * 创建用户ID
     */
    @ApiModelProperty(value = "创建用户ID", example = "1")
    private String createUser;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", example = "2021-01-11 10:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;


    /**
     * 创建用户ID
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "创建用户姓名", example = "1")
    private String createUserName;

    /**
     * 发布时间
     */
    @ApiModelProperty(value = "发布时间", example = "2021-01-11 10:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishTime;

    /**
     * 数据来源ID
     */
    @ApiModelProperty(value = "作业状态", example = "1 启用 0停用")
    private Integer state;

    @ApiModelProperty(value = "类型 1-前端应用 2-后端作业", example = "1")
    @TableField(exist = false)
    private Integer type;

    @ApiModelProperty(value = "导入时间")
    @TableField(exist = false)
    private String importTime;

    @ApiModelProperty(value = "数据源ID", example = "1")
    @TableField(exist = false)
    private Integer datasourceId;

}
